package com.hawthorn.admin.repository;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hawthorn.admin.repository.provider.SysMessageSqlProvider;
import com.hawthorn.entity.po.SysMessagePO;
import com.hawthorn.platform.repository.DBMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>todo 提醒信息表(sys_message) Mapper 接口</p>
 * @author: andyten@tom.com | xukaixing@hotmail.com
 * @created: 2021-12-11
 * @version v1.0.2
 * @copyright: Copyright (c)  andyten@tom.com | xukaixing@hotmail.com
 */
@Repository
public interface SysMessageMapper extends DBMapper<SysMessagePO>
{

  @SelectProvider(SysMessageSqlProvider.class)
  IPage<Map<String, Object>> findAllMsg(Page<Map<String, Object>> page, String conditions, String userAccount, Long deptId, Long oemCompanyId);

  @SelectProvider(type = SysMessageSqlProvider.class)
  Integer findMsgOneWeekNums(@Param("userAccount") String userAccount, @Param("oemCompanyId") Long oemCompanyId, @Param("deptId") Long deptId);

  @SelectProvider(type = SysMessageSqlProvider.class)
  List<Map<String, Object>> findMsgOneWeek(@Param("userAccount") String userAccount, @Param("oemCompanyId") Long oemCompanyId, @Param("deptId") Long deptId);

  @SelectProvider(type = SysMessageSqlProvider.class)
  List<Map<String, Object>> findMsgOneWeek2(@Param("userAccount") String userAccount, @Param("oemCompanyId") Long oemCompanyId, @Param("deptId") Long deptId);

  List<Map<String, Object>> findMsgForceView(@Param("userAccount") String userAccount, @Param("oemCompanyId") Long oemCompanyId, @Param("deptId") Long deptId);
}
